# 导包
import time
from selenium import webdriver
from selenium.webdriver import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options

# 打开浏览器
service = Service(r"D://Python314//chromedriver.exe")
chrome_options = Options()
chrome_options.add_experimental_option("detach", True)
driver = webdriver.Chrome(service=service, options=chrome_options)   # 创建浏览器对象


# 2.输入访问地址（URL）
driver.get("http://121.43.169.97:8848/pageA.html")

# 放大浏览器页面
driver.maximize_window()

time.sleep(2)
#选择'上海'
# 通过css定位，通过标签option的属性值 value 定位
driver.find_element(By.CSS_SELECTOR,"[value='sh']").click()
time.sleep(2)
driver.find_element(By.CSS_SELECTOR,"[value='gz']").click()


# sleep(3)
# driver.quit()